package com.hongyi.system.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.hongyi.common.mybatis.annotation.DataColumn;
import com.hongyi.common.mybatis.annotation.DataPermission;
import com.hongyi.common.mybatis.mapper.BaseMapperExtend;
import com.hongyi.system.domain.SysDept;
import com.hongyi.system.domain.vo.SysDeptVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SysDeptMapper extends BaseMapperExtend<SysDept, SysDeptVo> {

    @DataPermission({
            @DataColumn(key = "deptName", value = "dept_id")
    })
    List<SysDeptVo> selectDeptList(@Param(Constants.WRAPPER) Wrapper<SysDept> queryWrapper);

    /**
     * 根据角色ID查询部门树信息
     *
     * @param roleId            角色ID
     * @param deptCheckStrictly 部门树选择项是否关联显示
     * @return 选中部门列表
     */
    List<Integer> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);


}